# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dkmc
pkgver=56.3c238f0
pkgrel=3
pkgdesc='Dont kill my cat - Malicious payload evasion tool.'
groups=('blackarch' 'blackarch-exploitation' 'blackarch-networking')
arch=('any')
url='https://github.com/Mr-Un1k0d3r/DKMC'
license=('GPL3')
depends=('python2')
makedepends=('git')
source=("$pkgname::git+https://github.com/Mr-Un1k0d3r/DKMC.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" \
    'DKMC presentation 2017.pdf' README.md
  install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm *.md *.pdf

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

